{% extends "personal_center/base.html" %}
<!--固定资产付款创建页-->
{% block page_link %}
    <link rel="stylesheet" href="../../static/system_setup/css/style.css">
    <link rel="stylesheet" href="../../static/personnel/TimeSelector/skin/jedate.css">
    <link rel="stylesheet" href="../../static/finance/js/lib/zepto.css" type="text/css">
    <script src="../../static/finance/js/lib/jquery-1.10.2.js"></script>
    <script src="../../static/finance/js/lib/zepto.min.js"></script>
    <script src="../../static/finance/js/lib/lrz.min.js"></script>
    <link rel="stylesheet" href="../../static/public_file/css/ApprovalBox.css">
    <link rel="stylesheet" href="../../static/public_file/css/PersonnelChooser.css">
{% endblock %}


{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }
        tr {
            height: 37px;
        }
        th {
            text-align: center;
        }
        .file {
            position: relative;display: inline-block;background: #D0EEFF;border: 1px solid #99D3F5;border-radius: 4px;padding: 4px 12px;overflow: hidden;color: #1E88C7;text-decoration: none;text-indent: 0;line-height: 20px;
        }
        .file input {
            position: absolute;font-size: 100px;right: 0;top: 0;opacity: 0;
        }
        .file:hover {
            background: #AADFFD;border-color: #78C3F3;color: #004974;text-decoration: none;
        }
        .top_tag {
            border-bottom: #01AAED solid 2px;color: #01AAED;
        }
        .tab_top {
            width: 100px;height: 40px;line-height: 40px;text-align: center;display: inline-block;cursor: pointer;
        }
        .button_for_control {
            width: 90px;height: 30px;border: 1px solid #99D3F5;background: #D0EEFF;border-radius: 4px;letter-spacing: 0;line-height: 30px;color: #089bab;margin: 5px 0;
        }
        #page_one button:hover {
            color: red;
        }
        .time-adress-td {
            border: #cfcfcf solid 0.5px;width: 95%;margin-left: 2.5%;margin-top: 1%;height: 40px;padding-left: 0.5%;line-height: 40px;outline: none;
        }
        .time_input {
            text-align: left;width: 100%;border: none;font-size: 8px;outline: none;
        }
        .search {
            width: 300px;display: flex;float: right;margin: 10px 0;margin-right: 1%;
        }
        .search input {
            vertical-align: middle;float: left;flex: 4;height: 30px;width: 230px;outline: none;border: 1px solid #0070c1;box-sizing: border-box;border-bottom-left-radius: 3px;border-top-left-radius: 3px;
        }
        .search button {
            float: right;flex: 1;height: 30px;width: 70px;line-height: 30px;background-color: #0070c1;color: white;border-style: none;outline: none;border-bottom-right-radius: 3px;border-top-right-radius: 3px;
        }
        .search button i {
            font-style: normal;
        }
        .search button:hover {
            font-size: 16px;
        }
        .li-class {
            list-style: none;margin-top: 2%;color: #0b0b0b;cursor: pointer;height: 30px;line-height: 30px;
        }
        .add_background {
            background: #A9A9A9;
        }
        .a_tag_cla{
            display: block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;height: 30px;line-height: 30px;padding-left: 1%;
        }
        .table_td{
            border: #cfcfcf solid 0.5px;height: 40px;text-align: center;width: 5%;
        }
        #total_table tr td input{
            width: 100%;border: none;text-align: center;
        }
        .span_class {
            height: 30px;line-height: 30px;display: inline-block;vertical-align: top;border: #cfcfcf solid 0.5px;background: #cfcfcf;padding-right: 10px;padding-left: 10px;margin-top: 2.5px;margin-left: 0.5%;
        }
        #addForm5 {
            width: 800px;height: 500px;background: #F5F5F5;position: absolute;border: #dfdfdf solid 1px;margin: auto;border-radius: 3px;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 10100;font-size: 0;
        }
        #title4 {
            display: flex;justify-content: space-between;text-align: right;box-sizing: border-box;padding: 0 10px;height: 40px;color: #0b0b0b;cursor: move;width: 100%;background: #f4f7fa;border-top-left-radius: 5px;border-top-right-radius: 5px;
        }
        .flow {
            width: 100px;height: 30px;line-height: 30px;display: inline-block;vertical-align: top;text-align: center;cursor: pointer;
        }
        .flow-color {
            border-bottom: #00a0e9 solid 0.5px;color: #00a0e9;
        }
        #ThreeNavigation div {
            padding-left: 2%;
        }
    </style>
{% endblock %}


{% block right_content %}
    <div class="headline">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>
        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="lct_tag" class="tab_top" onclick="change_mind('lct')">
            流程图
        </div>
        <div id="" style="width: 100px;float: right;text-align: center;margin-right: 1%;height: 40px;">
            <button id="" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
                    style="width: 100px;height: 30px;line-height: 27px;border: #1E90FF solid 1px;background: #1E90FF;color: white;margin-top: 5px;border-radius: 3px;">
                操作
            </button>
        </div>

        <div style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;">
            <button style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                <a onclick="javascript:history.back(-1)" style="color: white;">返回</a></button>
        </div>
        <!-- 操作按钮隐藏块 -->
        <div id="page_one" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
             style="z-index: 1000; position: absolute; width: 100px; height: auto;right: 0.9%; top: 80px;background: #FFFFFF; box-shadow: rgb(204 204 204) 2px 2px 10px;padding: 5px;display: none;">
            <button onclick="print_topics()" class="button_for_control">
                打印
            </button>
            {% if is_audit == 'true' and is_edit == 'false' %}
                <button id="approve" onclick="online_approval_tag()" class="button_for_control">
                    审批
                </button>
            {% endif %}

            {% if is_recall == 'true' and is_edit == 'false' %}
                <button id="is_recall" onclick="operate_button(this.id)" class="button_for_control">
                    撤回
                </button>
            {% endif %}

            {% if is_cancel == 'true' and is_edit == 'false' %}
                <button id="is_cancel" onclick="operate_button(this.id)" class="button_for_control">
                    作废
                </button>
            {% endif %}

            {% if is_stop == 'true' and is_edit == 'false' %}
                <button id="is_stop" onclick="operate_button(this.id)" class="button_for_control">
                    终止
                </button>
            {% endif %}

            {% if is_edit == 'true' %}
                <button id="add_station" type="button" class="button_for_control" onclick="ExportCar()">
                    提交
                </button>
            {% endif %}
        </div>
    </div>
    <hr>

    <div id="appave-model" class="approval-shade">
        <div id="examine-model" style="width: 700px;background: white;left: 50%;top: 50%;position: absolute;transform: translate(-50%, -50%);">
            <div id="appave-title" style="width: 100%;height: 40px;border-bottom: #cfcfcf solid 1px;font-size: 14px;cursor: move;">
                <div style="width: 40%;height: 40px;line-height: 40px;text-align: left;padding-left: 1%;letter-spacing: 2px;float: left;">
                    审批
                </div>
                <div style="width: 59%;height: 40px;letter-spacing: 2px;float: left;">
                    <div onclick="close_approval_models()" style="width: 40px;height: 40px;text-align: center;line-height: 40px;cursor: pointer;float: right;">
                        <i class="iconfont icon-quchu"></i>
                    </div>
                </div>
            </div>

            <div style="width: 100%;font-size: 14px;background: #E8E8E8;padding-top: 1%;">
                <div style="width: 98%;height: 150px;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;padding-right: 1%;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        基本信息
                    </div>
                    <div style="width: 100%;height: 125px;padding-left: 1%;">
                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">出差事由：</span>{{ data_obj.business_matter }}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">出差人：</span>{{ data_obj.travel_people }}
                            </div>
                        </div>

                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">经费来源：</span>{% if trave_obj.SourceFunds == '1' %} 学科经费 {% elif trave_obj.SourceFunds == '2' %} 公卫经费 {% else %} 自有经费 {% endif %}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">报销金额：</span>{{ data_obj.total }}
                            </div>
                        </div>
                    </div>
                </div>

                <div style="width: 98%;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;margin-top: 1%;padding-right: 1%;padding-bottom: 20px;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        意见
                    </div>
                    {% if trave_obj.state == 'six' %}
                        <div style="margin-top: 3%;width: 100%;">
                            <input type="text" id="ReimbursementAmount" style="width: 96%;height: 30px;border: #cfcfcf solid 1px;margin-left: 2%;" placeholder="请填写实际报销金额">
                        </div>
                    {% endif %}
                    <div style="width: 100%;">
                        <textarea id="opinion_detail" placeholder="请输入审批意见" style="width: 96%;height: 100px;margin-left: 2%;margin-top: 2%;border: #cfcfcf solid 1px;outline: none;font-size: 14px;" ></textarea>
                    </div>
                </div>

                <div style="width: 100%;height: 40px;background: white;margin-top: 1%;text-align: right;padding-right: 2%;">
                    <button onclick="summit_data('audit')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;">同意</button>
                    <button onclick="summit_data('draft')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;margin-left: 15px;">退回修改</button>
                </div>
            </div>
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 95%;background: white;overflow: auto;">
        <div id="menu_from" style="width: 100%;height: 100%;color: #2C3E50;display: inline-block;vertical-align: top;background: white;">
            <div style="width: 90%;height: 90%;display: inline-block;vertical-align: center;margin-left: 5%;margin-top: 20px;">
                <div style="width: 100%;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td colspan="18" style="height: 45px;text-align: center;font-size: 23px;border: #cfcfcf 1px solid;border-bottom: none;">差旅报销申请</td>
                        </tr>
                        <tr>
                            <td colspan="18" style="border: #cfcfcf solid 0.5px;width: 95%;margin-left: 2.5%;margin-top: 1%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;">
                                基本信息
                            </td>
                        </tr>
                        <tr style="width: 100%;">
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                申&nbsp;&nbsp;&nbsp;请&nbsp;&nbsp;&nbsp;人
                            </td>
                            <td id="applicat" colspan="6" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;">
                                {{ apply }}
                            </td>
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;height: 37px;line-height: 37px;text-align: right;padding-right: 1%;" colspan="3">
                                所&nbsp;属&nbsp;科&nbsp;室
                            </td>
                            <td id="company" colspan="5" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;">{{ company }}</td>
                        </tr>
                        <tr style="width: 100%;">
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                出&nbsp;&nbsp;&nbsp;差&nbsp;&nbsp;&nbsp;人
                            </td>
                            {% if is_edit == 'true' %}
                                <td colspan="6" id="business_people" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;" onclick="model_line()">
                                    <input id="conferee" type="text" style="border: none;outline: none;width: 98%;height: 100%;" value="{{ data_obj.travel_people }}">
                                </td>
                            {% else %}
                                <td colspan="6" id="business_people" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;">
                                    {{ data_obj.travel_people }}
                                </td>
                            {% endif %}

                            <td colspan="3" style="width: 10%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                申&nbsp;请&nbsp;时&nbsp;间
                            </td>
                            <td colspan="5" id="apply_time" style="width: 24%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;">
                                {{ data_obj.apply_time }}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 10%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                出&nbsp;差&nbsp;天&nbsp;数
                            </td>
                            <td colspan="6" id="business_days" style="width: 24%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;" contenteditable="{{ is_edit }}">
                                {{ data_obj.business_days }}
                            </td>

                            <td colspan="3" style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                经&nbsp;费&nbsp;来&nbsp;源
                            </td>
                            <td colspan="5" id="SourceFunds" style="height: 26px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;">
                                {% if is_edit == 'true' %}
                                    <input type="checkbox" class="checked_rdo" name="rdo" onclick="SingleChoice(this)" value="1" {% if trave_obj.SourceFunds == '1' %} checked {% endif %} > 学科经费 &nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" class="checked_rdo" name="rdo" onclick="SingleChoice(this)" value="2" {% if trave_obj.SourceFunds == '2' %} checked {% endif %} > 公卫经费 &nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" class="checked_rdo" name="rdo" onclick="SingleChoice(this)" value="3" {% if trave_obj.SourceFunds == '3' %} checked {% endif %} > 自有经费
                                {% else %}
                                    {% if trave_obj.SourceFunds == '1' %}
                                        学科经费
                                    {% elif trave_obj.SourceFunds == '2' %}
                                        公卫经费
                                    {% else %}
                                        自有经费
                                    {% endif %}
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                收&nbsp;&nbsp;&nbsp;款&nbsp;&nbsp;&nbsp;人
                            </td>
                            <td id="payee" colspan="6" style="height: 26px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;" contenteditable="{{ is_edit }}">{{ data_obj.payee }}
                            </td>
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;height: 37px;line-height: 37px;text-align: right;padding-right: 1%;" colspan="3">
                                发&nbsp;&nbsp;&nbsp;票&nbsp;&nbsp;&nbsp;号
                            </td>
                            <td  colspan="5" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;">
                                <input id="invoice_number" type="text" style="width: 95%;height: 100%;border: none;outline: none;" value="{{ invoice_number }}" placeholder="多个发票号中间使用'，'隔开">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                出&nbsp;差&nbsp;事&nbsp;由
                            </td>
                            <td colspan="15" id="business_matter" style="height: 26px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;" contenteditable="{{ is_edit }}">{{ data_obj.business_matter }}</td>
                        </tr>
                        <tr>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;">
                                关&nbsp;联&nbsp;流&nbsp;程
                            </td>
                            <td id="AssociatedProcess" colspan="15" style="width: 85%;height: 35px;line-height: 37px;border: #cfcfcf solid 0.5px;outline: none;" {% if is_edit == 'true' %}  ondblclick="line_modes()" {% endif %}>
                                {% if trave_obj.relevance %}
                                    <p class="span_class" id="tar_span"><a href="travel_apply_detail_view?id={{ trave_obj.relevance.id }}" class="a_tag_tar" id="{{ trave_obj.relevance.id }}">差旅：{{ trave_obj.relevance.subject }}</a></p>
                                {% endif %}
                                {% if trave_obj.relevance_car %}
                                    {% for relevance in relevance_list %}
                                        <p class="span_class veh_tag" id="veh_span{{ relevance.id }}"><a href="/personal-center/Vehicle_apply_detail.html?id={{ relevance.id }}" class="a_tag_veh" id="{{ relevance.id }}">用车：{{ relevance.subject }}</a></p>
                                    {% endfor %}
                                {% endif %}
                                {% if trave_obj.relevance_zc %}
                                    <p class="span_class" id="out_span"><a href="middle_level_detail.html?id={{ trave_obj.relevance_zc.id }}" class="a_tag_out" id="{{ trave_obj.relevance_zc.id }}">干部外出：{{ trave_obj.relevance_zc.title }}</a></p>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 8%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;border-bottom: none">
                                备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                            </td>
                            <td id="remarks" colspan="15" style="width: 26%;height: 37px;line-height: 37px;padding-left: 1%;border: #cfcfcf solid 0.5px;outline: none;border-bottom: none" contenteditable="{{ is_edit }}">{{ data_obj.remarks }}</td>
                        </tr>
                    </table>
                    <table  style="width: 100%" id="total_table">                     <!--主体表-->
                        <tr style="border-top: #cfcfcf solid 0.5px">
                            <td colspan="18" style="border: #cfcfcf solid 0.5px;width: 95%;margin-left: 2.5%;margin-top: 1%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;text-align: left;border-top: none">
                                <span style="">费用详情</span>
                                {% if is_edit == 'true' %}
                                    <span style="float: right;padding-right: 10px;color: #00a0e9;cursor: pointer;" onclick="add_total_project()">添加</span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7" style="border: #cfcfcf solid 0.5px;  text-align: center">起止时间及地点</td>
                            <td colspan="2" style="border: #cfcfcf solid 0.5px;  text-align: center">城市间交通费</td>
                            <td colspan="3" style="border: #cfcfcf solid 0.5px;  text-align: center">住宿费</td>
                            <td colspan="3" style="border: #cfcfcf solid 0.5px;  text-align: center"><p id="demo-3">伙食补助费(元)</td>
                            <td colspan="3" style="border: #cfcfcf solid 0.5px;  text-align: center"><p id="demo-1">交通补助费</td>
                        </tr>
                        <tr>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;line-height: 40px">年</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">月</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">日</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">起点</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">月</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">日</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">终点</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">交通工具</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">金额</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">人数</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">天数</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">金额</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">人数</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">天数</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">金额</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">人数</td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center">天数</td>
                            <td style="width: 15%; border: #cfcfcf solid 0.5px;  text-align: center">金额</td>
                        </tr>
                    {% if data_obj.TotalList|length %}
                        {% for item in data_obj.TotalList %}
                            {% if is_edit == 'true' %}
                                <tr>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_y_num" maxlength="4" value="{{ item.R }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_m_num" oninput="if (value>12)value=12;if (value<=0)value=1" value="{{ item.A }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_j_num" value="{{ item.B }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="s_p" value='{{ item.C }}'></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_m_num" oninput="if (value>12)value=12;if (value<=0)value=1" value="{{ item.D }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_j_num" value="{{ item.E }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="e_p" value="{{ item.F }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="t_c" value="{{ item.G }}"></td>
                                    <td class="t_num" onblur=change_float(this,'T') contentEditable="true" style="outline:none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.H }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_p_num" value="{{ item.I }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_d_num" value="{{ item.J }}"></td>
                                    <td class="q_m_num" onblur=change_float(this,'T') contentEditable="true" style="outline: none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.K }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_p_num" value="{{ item.L }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_d_num" value="{{ item.M }}"></td>
                                    <td class="f_m_num" onblur=change_float(this,'T') contentEditable="true" style="outline: none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.N }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_p_num" value="{{ item.O }}"></td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_d_num" value="{{ item.P }}"></td>
                                    <td style="outline:none ;width: 15%; border: #cfcfcf solid 0.5px;border-bottom: none;text-align: center">
                                        <span class="i_t_m_num" onblur=change_float(this,'T') contentEditable="true" style="padding-left: 10px;outline: none;width:70%; display: -moz-inline-box; display: inline-block;">{{ item.Q }}</span>
                                        <span onclick="remove_time_adress(this, '1')" style="color: red; cursor: pointer; display: inline-block;">删除</span>
                                    </td>
                                </tr>
                            {% else %}
                                <tr>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.R }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.A }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.B }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.C }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.D }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.E }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.F }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.G }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.H }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.I }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.J }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.K }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.L }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.M }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.N }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.O }}</td>
                                    <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px">{{ item.P }}</td>
                                    <td style="width: 15%; border: #cfcfcf solid 0.5px;border-bottom: none;  text-align: center">{{ item.Q }}</td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                    {% else %}
                        {% if is_edit == 'true' %}
                            <tr>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_y_num" maxlength="4"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_m_num" oninput="if (value>12)value=12;if (value<=0)value=''"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_j_num"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="s_p"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_m_num" maxlength="4"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_j_num" ></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="e_p" ></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="t_c" ></td>
                                <td class="t_num" onblur=change_float(this,'T') contentEditable="true" style="outline:none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_p_num"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_d_num"></td>
                                <td class="q_m_num" onblur=change_float(this,'T') contentEditable="true" style="outline: none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_p_num"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_d_num"></td>
                                <td class="f_m_num" onblur=change_float(this,'T') contentEditable="true" style="outline: none;width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_p_num"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_d_num"></td>
                                <td style="outline:none ;width: 15%; border: #cfcfcf solid 0.5px;border-bottom: none;text-align: center">
                                    <span class="i_t_m_num" onblur=change_float(this,'T') contentEditable="true" style="padding-left: 10px;outline: none;width:70%; display: -moz-inline-box; display: inline-block;"></span>
                                    <span onclick="remove_time_adress(this, '1')" style="color: red; cursor: pointer; display: inline-block;">删除</span>
                                </td>
                            </tr>
                        {% else %}
                            <tr>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"></td>
                                <td style="width: 15%; border: #cfcfcf solid 0.5px;border-bottom: none;  text-align: center"></td>
                            </tr>
                        {% endif %}
                    {% endif %}

                    </table>

                    <table style="width: 100%;" id="other">
                        <tr>
                            <td colspan="18" style="border: #cfcfcf solid 0.5px;width: 95%;margin-left: 2.5%;margin-top: 1%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5">
                                <span style="letter-spacing:70px;">其他</span>
                                {% if is_edit == 'true' %}
                                    <span style="float: right;padding-right: 10px;color: #00a0e9;cursor: pointer;" onclick="add_other()">添加</span>
                                {% endif %}
                            </td>
                        </tr>
                        {% if data_obj.OtherList|length %}
                            {% for foo in data_obj.OtherList %}
                                <tr>
                                    <td colspan="3" class="time-adress-td" style="width: 10%;text-align: right;padding-right: 0.5%;border: #cfcfcf solid 0.5px;border-bottom: none">
                                        报销类型
                                    </td>
                                    <td colspan="6" class="time-adress-td other" colspan="3" style="width: 40%;border: #cfcfcf solid 0.5px;border-bottom: none" contenteditable="{{ is_edit }}">{{ foo.T }}</td>
                                    <td colspan="3" class="time-adress-td" style="width: 10%;text-align: right;padding-right: 1%;border: #cfcfcf solid 0.5px;border-bottom: none">
                                        发票金额
                                    </td>
                                    {% if is_edit == 'true' %}
                                        <td class="time-adress-td" colspan="6" style="width: 40%;border: #cfcfcf solid 0.5px;border-bottom: none;">
                                            <input class="other_input" type="text" style="width: 85%;height: 100%;border: none;outline: none;" value="{{ foo.U }}" onblur=change_float(this,'F')>
                                            <span style="float: right;padding-right: 10px;color: red;cursor: pointer;" onclick="remove_time_adress(this, '1')">删除</span>
                                        </td>
                                    {% else %}
                                        <td class="time-adress-td" colspan="6" style="width: 40%;border: #cfcfcf solid 0.5px;border-bottom: none">
                                            <input class="other_input" type="text" style="width: 100%;height: 100%;border: none;outline: none;" value="{{ foo.U }}" readonly>
                                        </td>
                                    {% endif %}
                                </tr>
                            {% endfor %}
                        {% else %}
                            <tr>
                                <td colspan="3" class="time-adress-td" style="width: 10%;text-align: right;padding-right: 0.5%;border: #cfcfcf solid 0.5px;border-bottom: none">
                                    报销类型
                                </td>
                                <td  class="time-adress-td other" colspan="6" style="width: 40%;border: #cfcfcf solid 0.5px;border-bottom: none;" contenteditable="{{ is_edit }}">
                                </td>
                                <td class="time-adress-td" colspan="3" style="width: 10%;text-align: right;padding-right: 1%;border: #cfcfcf solid 0.5px;border-bottom: none;">
                                    发票金额
                                </td>
                                <td class="time-adress-td" colspan="6" style="width: 40%;border: #cfcfcf solid 0.5px;border-bottom: none;">
                                    <input class="other_input" type="text" style="width: 100%;height: 100%;border: none;outline: none;" {% if is_edit == 'false' %}
                                           readonly
                                           {% else %}
                                           onblur="change_float(this,'F')"
                                    {% endif %}>
                                </td>
                            </tr>
                        {% endif %}
                    </table>

                    <table style="width: 100%;">
                        <tr>
                            <td colspan="18" style="border: #cfcfcf solid 0.5px;width: 95%;margin-left: 2.5%;margin-top: 1%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;">
                                <span style="letter-spacing:70px;">合计</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="width: 10%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 0.5%;border-bottom: none;">
                                合计(元)
                            </td>
                            <td id="total" colspan="6" style="width: 40%;height: 37px;line-height: 37px;padding-left: 0.5%;border: #cfcfcf solid 0.5px;border-top: none;outline: none;border-bottom: none;" {% if is_edit == 'true' %} onblur="change_daxie()" {% endif %} contenteditable="{{ is_edit }}">{{ data_obj.total }}</td>
                            <td style="width: 10%;border: #cfcfcf solid 0.5px;text-align: right;height: 37px;line-height: 37px;padding-right: 1%;border-top: none;border-bottom: none;" colspan="3">
                                大&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;写
                            </td>
                            <td id="total_daxie" colspan="6" style="width: 40%;height: 37px;line-height: 37px;padding-left: 0.5%;border: #cfcfcf solid 0.5px;border-top: none;outline: none;border-bottom: none;">{{ data_obj.total_daxie }}</td>
                        </tr>
                    </table>
                    <table style="width: 100%; ">
                        <tr>
                            <td colspan="18"
                                style="width: 90%;height: 40px;margin-left: 5%;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;padding-right: 1%;">
                                审批详情
                            </td>
                        </tr>
                        {% for k,v in audit_dic.items %}
                            {% if k == 'one' %}
                                <tr id="fzrcs_tr" style="width: 100%;">
                                    <td style="width: 15%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        科室负责人
                                    </td>
                                    <td id="fzrcs" style="width: 85%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div id="fzrcs_op" style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}

                        <!--财务科意见-->
                        {% for k,v in audit_dic.items %}
                            {% if k == 'two' %}
                                <tr id="fgld_tr" style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;" >
                                        财&nbsp;务&nbsp;出&nbsp;纳
                                    </td>
                                    <td id="zhuren"
                                        style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}

                        {% for k,v in audit_dic.items %}
                            {% if k == 'nine' %}
                                <tr id="jfly_tr" style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        经&nbsp;费&nbsp;来&nbsp;源
                                    </td>
                                    <td id="jfly" style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div id="jfly_op" style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}

                        {% for k,v in audit_dic.items %}
                            {% if k == 'three' %}
                                <!--分管领导意见-->
                                <tr id="ybzr_tr" style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        {% if trave_obj.id > 91 or trave_obj.id == 78 %}
                                            审计科审核
                                        {% else %}
                                            分&nbsp;管&nbsp;领&nbsp;导
                                        {% endif %}
                                    </td>
                                    <td id="fenguan"
                                        style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                        <!--财务科长意见-->
                        {% for k,v in audit_dic.items %}
                            {% if k == 'four' %}
                                <tr style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        财&nbsp;务&nbsp;科&nbsp;长
                                    </td>
                                    <td id="bangongshi"
                                        style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                        <!--院领导审核意见-->
                        {% for k,v in audit_dic.items %}
                            {% if k == 'five' %}
                                <tr style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        院领导审核
                                    </td>
                                    <td id="bangongshi"
                                        style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">

                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    {% if item.signature_picture %}
                                                        <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                    {% else %}
                                                        {{ item.audit_user }}
                                                    {% endif %}
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                        <!--出纳支付意见-->
                        {% for k,v in audit_dic.items %}
                            {% if k == 'six' %}
                                <tr style="width: 100%;">
                                    <td style="width: 10%;height: 100px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                        出&nbsp;纳&nbsp;支&nbsp;付
                                    </td>
                                    <td id="bangongshi" style="width: 90%;height: 100px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;">
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="display: inline-block;">
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        {% if item.signature_picture %}
                                                            <img src="{{ item.signature_picture }}" alt="" style="width: 150px; height: 60px;">
                                                        {% else %}
                                                            {{ item.audit_user }}
                                                        {% endif %}
                                                    </div>
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                        {% for foo in payment_obj %}
                                            <img src="{{ foo }}" data-src="{{ foo }}" style="width: 300px;height: 100px;display: inline-block;margin-top: 5px;margin-bottom: 5px;">
                                        {% endfor %}
                                    </td>
                                </tr>
                            {% endif %}
                        {% endfor %}
                    </table>
                </div>
                {% if is_edit == 'true' or realname == apply and trave_obj.state == 'four' %}
                    <div style="width: 100%;">
                        <div style="width: 100%;height: 40px;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;border-top: none;border-bottom: none;padding-right: 1%;">
                            上传附件
                            <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                                上传文件
                                <input type="file" name="party_main_body" id="party_main_body"
                                       onchange="upload_accessory('file1', 'party_main', 'party_main_body')">
                            </a>
                        </div>
                        <table style="width: 100%;">
                            <thead>
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    文件名称
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    文件大小
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    上传时间
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    上传人员
                                </td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                                </td>
                            </tr>
                            </thead>
                            <tbody style="overflow: auto;" id="party_main">
                            {% for record in file_list %}
                                <tr>
                                    <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">{{ forloop.counter }}</td>
                                    <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_name }}</td>
                                    <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_size }}</td>
                                    <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.upload_time }}</td>
                                    <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.uploader }}</td>
                                    <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;"><a target='_blank' href="{{ record.file_path }}">查看</a> | <a style="color: red;" href='#' onclick='RemoveTr(this, "party_main", {{ record.id }})' >删除</a></td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                {% endif %}
            </div>
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">
                {% for item in file_list %}
                    <div><a href="#" class="a_tag_cla" title="{{ item.file_name }}" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                {% endfor %}
            </div>

        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="lct" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 40%;text-align: center;margin: 20% auto;">
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    ({{ trave_obj.applicat.real_name }})<br>
                    发起人
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    start
                </div>
            </div>

            {% if 'one' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'one' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                科室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'two' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'two' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                财务出纳
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'nine' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'nine' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                经费来源
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'three' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'three' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                {% if trave_obj.id > 91 or trave_obj.id == 78 %}
                                    审计科审核
                                {% else %}
                                    分&nbsp;管&nbsp;领&nbsp;导
                                {% endif %}
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'four' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'four' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                财务科长
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'five' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'five' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                院领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'six' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'six' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                出纳支付
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <div style="display: inline-block;border: #0d8ddb solid 1px;width: 120px;vertical-align: bottom;margin-bottom: 12px;"></div>
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    <span style="visibility: hidden;">({{ obj.apply_user.real_name }})</span><br>
                    结束
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    ending
                </div>
            </div>
        </div>
    </div>

    <div id="staff-select" class="shade">
        <div id="staff-model" style="width: 100%;height: 100%;position: absolute;">
            <div style="width: 900px;height: 500px;background: #F5F5F5;z-index: 10000;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
                <div id="staff-box" style="width: 100%;height: 40px;background: #f4f7fa;cursor: move;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 40px;font-size: 14px;">
                        选择人员
                    </div>
                    <span onclick="close_model()" style="float: right;padding-right: 2%;cursor: pointer;line-height: 37px;">
                        <i class="iconfont icon-quchu"></i>
                    </span>
                </div>
                <div style="height: 460px;width: 100%;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 70px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div id="dep" class="navigation navigation_color" onclick="change_navigation(this)">部门</div>
                        <div id="limits" class="navigation" onclick="change_navigation(this)">权限</div>
                        <div id="fun" class="navigation" onclick="change_navigation(this)">职能</div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input id="SearchDep" onkeydown="SearchDepartment()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 95%;">
                        </div>
                        <div id="SecondaryNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;">
                            <input type="checkbox" id="select-all" onclick="SelectAll(this)">
                            <input id="SearchPeo" onkeydown="SearchProple()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 87%;">
                        </div>
                        <div id="ThreeNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 410px;height: 100%;display: inline-block;vertical-align: top;overflow: auto">
                        <div style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选 <span id="selected-number">0</span> 人
                        </div>
                        <div id="selected-div" style="width: 100%;font-size: 14px;height: 370px;overflow: auto;line-height: 20px;">

                        </div>
                        <div style="width: 100%;font-size: 14px;height: 40px;text-align: center;">
                            <button onclick="IdentifyPersonnel()" style="width: 100px;height: 30px;line-height: 25px;text-align: center;letter-spacing: 5px;border-radius: 3px;border: #cfcfcf solid 1px;font-size: 14px;cursor: pointer;margin-top: 10px;">完成</button>
                            <button onclick="close_model()" style="margin-left: 15px;width: 100px;height: 30px;line-height: 25px;text-align: center;color: #0abb78;letter-spacing: 5px;border-radius: 3px;font-size: 14px;border: #cfcfcf solid 1px;cursor: pointer;margin-top: 10px;">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="addForm4" class="shade" style="display: none;">
        <div id="addForm5">
            <div id="title4">
                <div style="width: 650px;height: 40px;line-height: 40px;display: inline-block;vertical-align: top;font-size: 13px;text-align: left;">
                    关联流程
                </div>
                <div style="cursor: move;height: 40px;line-height: 40px;width: 140px;display: inline-block;vertical-align: top;"><i class="iconfont icon-quchu" onclick="close_models4()" style="cursor: pointer;"></i></div>
            </div>
            <hr>
            <div style="display: inline-block;width: 100%;height: 415px;border-right: #E8E8E8 solid 1px;font-size: 14px;border-bottom: #CCCCCC solid 0.5px;">
                <div style="width: 100%;height: 30px;line-height: 30px;border-bottom: #CCCCCC solid 0.5px;">
                    <div id="flow-travel" class="flow flow-color" onclick="change_flow(this.id)">差旅申请</div>
                    <div id="flow-car" class="flow" onclick="change_flow(this.id)">用车申请</div>
                    <div id="flow-cadre" class="flow" onclick="change_flow(this.id)">中层干部外出</div>
                </div>
                <div id="flow-travel-tag" style="width: 100%;height: 380px;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                选择
                            </td>
                            <td style="width: 500px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                流程名称
                            </td>
                            <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                申请时间
                            </td>
                        </tr>
                    </table>
                    <div style="width: 100%;overflow-y: scroll;height: 350px;">
                        <table style="width: 100%;table-layout:fixed;word-wrap:break-word;word-break:break-all;">
                            {% for tar in Tra_obj %}
                                <tr style="width: 100%;">
                                    <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                        <input type="checkbox" onclick="checkall_input('tar', this, `{{ tar.subject }}`, '{{ tar.id }}')" class="tar_input" id="{{ tar.id }}">
                                    </td>
                                    <td style="width: 500px;height: 30px;line-height: 30px;text-align: left;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;word-wrap:break-word;padding-left: 0.5%;">
                                        {{ tar.subject }}
                                    </td>
                                    <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                        {{ tar.create_time|date:'Y-m-d H:i' }}
                                    </td>
                                </tr>
                            {% endfor %}
                        </table>
                    </div>
                </div>
                <div id="flow-car-tag" style="width: 100%;height: 380px;display: none;">
                    <table style="width: 100%;height: 30px;">
                        <tr style="width: 100%;">
                            <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                选择
                            </td>
                            <td style="width: 500px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                流程名称
                            </td>
                            <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                申请时间
                            </td>
                        </tr>
                    </table>
                    <div style="width: 100%;overflow-y: scroll;height: 350px;">
                        <table style="width: 100%;table-layout:fixed;word-wrap:break-word;word-break:break-all;">
                            {% for veh in Veh_obj %}
                                <tr style="width: 100%;">
                                    <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                        <input type="checkbox" onclick="checkall_input('veh', this, `{{ veh.subject }}`, '{{ veh.id }}')" data-value="{{ veh.subject }}" class="veh_input" id="{{ veh.id }}">
                                    </td>
                                    <td style="width: 500px;height: 30px;line-height: 30px;text-align: left;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;word-wrap:break-word;padding-left: 0.5%;">
                                        {{ veh.subject }}
                                    </td>
                                    <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                        {{ veh.create_time|date:'Y-m-d H:i' }}
                                    </td>
                                </tr>
                            {% endfor %}
                        </table>
                    </div>
                </div>
                <div id="flow-cadre-tag" style="width: 100%;height: 380px;display: none;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                选择
                            </td>
                            <td style="width: 500px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                流程名称
                            </td>
                            <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                申请时间
                            </td>
                        </tr>
                    </table>
                    <div style="width: 100%;overflow-y: scroll;height: 350px;">
                        <table style="width: 100%;table-layout:fixed;word-wrap:break-word;word-break:break-all;">
                            {% for out in out_obj %}
                                <tr style="width: 100%;">
                                    <td style="width: 50px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-left: none;border-top: none;">
                                        <input type="checkbox" onclick="checkall_input('out', this, `{{ out.title }}`, '{{ out.id }}')" class="out_input" id="{{ out.id }}">
                                    </td>
                                    <td style="width: 500px;height: 30px;line-height: 30px;text-align: left;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;word-wrap:break-word;padding-left: 0.5%;">
                                        {{ out.title }}
                                    </td>
                                    <td style="width: 150px;height: 30px;line-height: 30px;text-align: center;border: #CCCCCC solid 0.5px;border-right: none;border-top: none;">
                                        {{ out.create_time|date:'Y-m-d H:i' }}
                                    </td>
                                </tr>
                            {% endfor %}
                        </table>
                    </div>
                </div>
            </div>
            <div style="width: 100%;height: 42px;font-size: 14px;text-align: right;padding-right: 1%;">
                <button style="width: 75px;height: 30px;border: #00a0e9 solid 0.5px;border-radius: 3px;background: #00a0e9;color: white;margin-top: 6px;" onclick="close_models5()">确认</button>
            </div>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script type="text/javascript" src="../../static/personnel/TimeSelector/src/jedate.js"></script>
    <script type="text/javascript" src="../../static/personal_center/js/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="../../static/public_file/js/ApprovalBox.js"></script>
    <script type="text/javascript" src="../../static/public_file/js/PersonnelChoosersNew.js" charset="gb2312"></script>
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
            document.getElementById("personage").className = "add_class";
            document.getElementById("sponsor").className = "add-nav-active";
        };

        const uuid = '{{ uuid | safe }}'

        var status = "{{ status | safe }}";
        if (status === 'two') {
            document.getElementById("total").contentEditable='true';
        }

        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            } else if (ele_id === "LH") {
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            }else {
                document.getElementById("lct").style.display = "inline-block";
                document.getElementById("lct_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            }
        }

        function close_models4() {
            document.getElementById("addForm4").style.display = "none";
        }

        function close_models5() {
            document.getElementById("addForm4").style.display = "none";
            var veh_input_list = document.getElementsByClassName("veh_input");

            for (var hhh=0; hhh<10; hhh++) {
                var veh_list = document.getElementsByClassName("span_class veh_tag");
                if (veh_list.length) {
                    veh_list[0].parentNode.removeChild(veh_list[0]);
                }else {
                    break
                }
            }

            for (var vehs=0; vehs<veh_input_list.length; vehs++) {
                if (veh_input_list[vehs].checked) {
                    var title_value = veh_input_list[vehs].getAttribute("data-value");
                    var p_atg = document.createElement("p");p_atg.className="span_class veh_tag";p_atg.id="veh_span"+String(vehs+1);
                    var a_tag = document.createElement("a");a_tag.innerText="用车："+title_value;a_tag.href="/personal-center/Vehicle_apply_detail.html?id="+veh_input_list[vehs].id;a_tag.target="_blank";
                    a_tag.className="a_tag_veh";a_tag.id=veh_input_list[vehs].id;
                    p_atg.appendChild(a_tag);
                    document.getElementById("AssociatedProcess").appendChild(p_atg)
                }
            }
        }

        function line_modes() {
            document.getElementById("addForm4").style.display="table-row";
        }

        function change_flow(ele_id) {
            if (ele_id === "flow-travel") {
                document.getElementById("flow-travel").className = "flow flow-color";
                document.getElementById("flow-car").className = "flow";
                document.getElementById("flow-cadre").className = "flow";
                document.getElementById("flow-travel-tag").style.display = "inline-block";
                document.getElementById("flow-car-tag").style.display = "none";
                document.getElementById("flow-cadre-tag").style.display = "none";
            }else if (ele_id === "flow-car") {
                document.getElementById("flow-travel").className = "flow";
                document.getElementById("flow-car").className = "flow flow-color";
                document.getElementById("flow-cadre").className = "flow";
                document.getElementById("flow-travel-tag").style.display = "none";
                document.getElementById("flow-car-tag").style.display = "inline-block";
                document.getElementById("flow-cadre-tag").style.display = "none";
            }else {
                document.getElementById("flow-travel").className = "flow";
                document.getElementById("flow-car").className = "flow";
                document.getElementById("flow-cadre").className = "flow flow-color";
                document.getElementById("flow-travel-tag").style.display = "none";
                document.getElementById("flow-car-tag").style.display = "none";
                document.getElementById("flow-cadre-tag").style.display = "inline-block";
            }
        }

        function checkall_input(types, this_, title, this_id) {
            if (types === "tar") {
                var tar_input_list = document.getElementsByClassName("tar_input");
                for (var tars=0; tars<tar_input_list.length; tars++) {
                    tar_input_list[tars].checked=false
                }
                if (document.getElementById("tar_span")){
                    document.getElementById("tar_span").innerHTML = `<a class="a_tag_tar" id="`+this_id+`" href="travel_apply_detail_view?id=`+this_id+`">差旅：`+title+`</a>`
                }else {
                    var p_atg = document.createElement("p");p_atg.className="span_class";p_atg.id="tar_span";
                    var a_tag = document.createElement("a");a_tag.innerText="差旅："+title;a_tag.href="travel_apply_detail_view?id="+this_id;a_tag.target="_blank";
                    a_tag.className="a_tag_tar";a_tag.id=this_id
                    p_atg.appendChild(a_tag);
                    document.getElementById("AssociatedProcess").appendChild(p_atg)
                }
                this_.checked=true;
            }else if (types === "veh") {
                {#var veh_input_list = document.getElementsByClassName("veh_input");#}
                {#for (var vehs=0; vehs<veh_input_list.length; vehs++) {#}
                {#    veh_input_list[vehs].checked=false#}
                {# }#}
                {#if (document.getElementById("veh_span")) {#}
                {#    document.getElementById("veh_span").innerHTML = `<a class="a_tag_veh" id="`+this_id+`" href="/personal-center/Vehicle_apply_detail.html?id=`+this_id+`">用车：`+title+`</a>`#}
                {# }else {#}
                {#    p_atg = document.createElement("p");p_atg.className="span_class";p_atg.id="veh_span";#}
                {#    a_tag = document.createElement("a");a_tag.innerText="用车："+title;a_tag.href="/personal-center/Vehicle_apply_detail.html?id="+this_id;a_tag.target="_blank";#}
                {#    a_tag.className="a_tag_veh";a_tag.id=this_id#}
                {#    p_atg.appendChild(a_tag);#}
                {#    document.getElementById("AssociatedProcess").appendChild(p_atg)#}
                {# }#}
            }else {
                var out_input_list = document.getElementsByClassName("out_input");
                for (var outs=0; outs<out_input_list.length; outs++) {
                    out_input_list[outs].checked=false
                }
                if (document.getElementById("out_span")) {
                    document.getElementById("out_span").innerHTML = `<a class="a_tag_out" id="`+this_id+`" href="middle_level_detail.html?id=`+this_id+`">干部外出：`+title+`</a>`
                }else {
                    p_atg = document.createElement("p");p_atg.className="span_class";p_atg.id="out_span";
                    a_tag = document.createElement("a");a_tag.innerText="干部外出："+title;a_tag.href="middle_level_detail.html?id="+this_id;a_tag.target="_blank";
                    a_tag.className="a_tag_out";a_tag.id=this_id
                    p_atg.appendChild(a_tag);
                    document.getElementById("AssociatedProcess").appendChild(p_atg)
                }
                this_.checked=true;
            }
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        // 上传附件
        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', uuid)
            form.append('source', 'qj')     // 请假
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData, tbody_id) {
            var t_table = document.getElementById(tbody_id);
            var local_host = window.location.host;
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                    td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                    td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                    td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                    td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                    td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                    td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"][i]["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["pdf_path"][i]["id"] + "\")'>删除</a>";
                    td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                    tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                    t_table.appendChild(tr);
                }
                if (JsonData["pdf_path"].length > 1) {
                    document.getElementById("del_adjunct").style.display = 'block';
                }
            } else {
                var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["id"] + "\")'>删除</a>";
                td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);t_table.appendChild(tr);
            }
        }

        function RemoveTr(_this, tbody_id, wj_id) {
            var table = document.getElementById(tbody_id);
            var trNode = $(_this).parent().parent();
            trNode.remove();

            for (var i = 0; i < table.children.length; i++) {
                table.children[i].children[0].innerHTML = i + 1;
            }

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
            };
        }

        function page_zhanshi() {
            document.getElementById('page_one').style.display = 'inline-block';
        }

        function page_yincang() {
            document.getElementById('page_one').style.display = 'none';
        }

        function online_tag() {
            document.getElementById("new_models2").style.display = "table";
        }

        function close_models() {
            document.getElementById("new_models2").style.display = "none";
        }

        function summit_data(approve) {
            var audit_note = document.getElementById("opinion_detail").value;
            var ReimbursementAmount = "";
            var six_flag = "{{ trave_obj.state }}";
            if (approve === "draft") {
                if (!audit_note) {
                    alert("不同意请填写理由！");
                    return false
                }
            }
            if (six_flag === 'six' && approve === 'audit') {
                ReimbursementAmount = document.getElementById("ReimbursementAmount").value;
                if (!ReimbursementAmount) {
                    alert("请填写实际报销金额！");
                    return false
                }
            }
            var note_str = "id={{ trave_obj.id }}&state=" + String(approve) + "&audit_note=" + String(audit_note) + "&ReimbursementAmount=" + String(ReimbursementAmount);
            console.log(note_str)
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/finance/travel_approval.html");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send(note_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("审批成功");
                            window.location.href = '/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd='
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        function ExportCar(draft='0') {
            var travel_id = "{{ id | safe }}";
            var revise = "{{ revise | safe }}";
            var checked_rdo_list = document.getElementsByClassName("checked_rdo");  <!-- 经费来源-->
            var SourceFunds = ''
            for (var i=0; i<checked_rdo_list.length; i++){
                if (checked_rdo_list[i].checked){
                    SourceFunds = checked_rdo_list[i].value
                }
            }
            if (draft === '0') {
                if (!document.getElementById("conferee").value){
                    alert("出差人不能为空！");
                    return false
                }
                if (!document.getElementById("business_matter").innerText){
                    alert("出差事由不能为空！");
                    return false
                }
                var administrative_table = document.getElementById('party_main');
                if (!administrative_table.children.length){
                    alert("请上传附件！");
                    return false
                }
                if (!SourceFunds){
                    alert("请选择经费类型！");
                    return false
                }
                if (!document.getElementById("payee").innerText) {
                    alert("收款人不能为空！");
                    return false
                }
                if (!document.getElementById("invoice_number").value) {
                    alert("发票号不能为空！");
                    return false
                }
             }

            change_float1();

            var a_tag_tar_list = document.getElementsByClassName("a_tag_tar")
            var a_tag_veh_list = document.getElementsByClassName("a_tag_veh")
            var a_tag_out_list = document.getElementsByClassName("a_tag_out")
            var form = new FormData();
            var reimburse_dict = {};var OtherList = [];var TotalList = [];
            form.append("invoice_number", document.getElementById("invoice_number").value);             // 发票号
            form.append("apply_time", document.getElementById("apply_time").innerText);                 // 申请时间
            form.append("travel_people", document.getElementById("conferee").value);                 // 出差人
            form.append("vote_reluse", $("input[type=radio][name=or_car]:checked").val());                // 是否派车
            form.append("business_days", parseInt(document.getElementById("business_days").innerText));       // 出差天数
            form.append("business_matter", document.getElementById("business_matter").innerText);                // 出差事由
            form.append("remarks", document.getElementById("remarks").innerText)                            // 备注
            form.append("total", document.getElementById("total").innerText.trim())                            // 合计
            form.append("total_daxie", document.getElementById("total_daxie").innerText.trim())                            // 大写
            form.append("payee", document.getElementById("payee").innerText.trim())                            // 收款人
            form.append("uuid", uuid);
            form.append("draft", draft);
            form.append("travel_id", travel_id);
            form.append("SourceFunds", SourceFunds)
            form.append("flow_type", '1111111')
            if (a_tag_tar_list.length) {
                form.append("tar_id", a_tag_tar_list[0].id)                 // 差旅报销流程关联
            }
            if (a_tag_veh_list.length){
                form.append("veh_id", a_tag_veh_list[0].id)                                             // 用车流程关联
                var veh_list = []
                for (var tttt=0; tttt<a_tag_veh_list.length; tttt++) {
                    veh_list.push(a_tag_veh_list[tttt].id)
                }
                form.append("veh_list", JSON.stringify(veh_list))
            }
            if (a_tag_out_list.length) {
                form.append("out_id", a_tag_out_list[0].id)                                             // 中层干部外出流程关联
            }
            if (revise === 'true'){
                form.append("revise", revise);
            }
            if (!Number(document.getElementById("total").innerText.replace(',', '').replace(',', '').replace(',', '').trim())){
                alert("创建报销流程金额不能为0！")
                return false
            }


            var rr = document.getElementsByClassName("s_y_num")
            var aa = document.getElementsByClassName("s_m_num")
            var bb = document.getElementsByClassName('s_j_num')
            var cc = document.getElementsByClassName('s_p')
            var dd = document.getElementsByClassName('e_m_num')
            var ee = document.getElementsByClassName('e_j_num')
            var ff = document.getElementsByClassName('e_p')
            var gg = document.getElementsByClassName('t_c')
            var hh = document.getElementsByClassName('t_num')
            var ii = document.getElementsByClassName('q_p_num')
            var jj = document.getElementsByClassName('q_d_num')
            var kk = document.getElementsByClassName('q_m_num')
            var ll = document.getElementsByClassName('f_p_num')
            var mm = document.getElementsByClassName('f_d_num')
            var nn = document.getElementsByClassName('f_m_num')
            var oo = document.getElementsByClassName('i_t_p_num')
            var pp = document.getElementsByClassName('i_t_d_num')
            var qq = document.getElementsByClassName('i_t_m_num')
            var tt = document.getElementsByClassName('time-adress-td other')
            var uu = document.getElementsByClassName('other_input')
            for (var m=0;m<aa.length;m++){
                TotalList.push({'A': aa[m].value, 'B':bb[m].value, 'C': cc[m].value, 'D': dd[m].value, 'E': ee[m].value, 'F': ff[m].value,
                        "G": gg[m].value, 'H': hh[m].innerText, "I": ii[m].value, 'J':jj[m].value, 'K': kk[m].innerText,
                        "L": ll[m].value, "M": mm[m].value, "N": nn[m].innerText, 'O': oo[m].value, 'P': pp[m].value, 'Q': qq[m].innerText, 'R': rr[m].value, "count_m": m})
            }
            reimburse_dict['TotalList'] = TotalList

            for (var n=0;n<tt.length;n++) {
                OtherList.push({'T': tt[n].innerText, 'U': uu[n].value})
            }
            reimburse_dict['OtherList'] = OtherList
            {#console.log("reimburse_dict: ", reimburse_dict)#}
            form.append("reimburse_dict", JSON.stringify(reimburse_dict))
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/finance/travel_reimbursement.html", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("修改成功！")
                            window.location.href = "/finance/reimbursement_list.html"
                        } else {
                            alert(JsonDate["message"])
                        }
                    }
                }
             };
        }

        function change_float1() {
            var cjjtf = 0;var zsf = 0; var hsf = 0; var cwjtf = 0;var total = 0;var other_fee = 0;

            var traffic_money = document.getElementsByClassName("t_num")
            var sleep_money = document.getElementsByClassName("q_m_num")
            var flood_money = document.getElementsByClassName('f_m_num')
            var city_traffic = document.getElementsByClassName("i_t_m_num")
            var other_fee_li = document.getElementsByClassName('other_input')

            for (var traffic=0; traffic<traffic_money.length; traffic++) {
                if (traffic_money[traffic].innerText.replace(",", '').replace(",", '').trim()) {
                    traffic_money[traffic].innerText = formatMonenyNumber(traffic_money[traffic].innerText.replace(",", '').replace(",", '').trim());
                }
            }


            for (var sleep=0; sleep<sleep_money.length; sleep++) {
                if (sleep_money[sleep].innerText.replace(",", '').replace(",", '').trim()) {
                    sleep_money[sleep].innerText = formatMonenyNumber(sleep_money[sleep].innerText.replace(",", '').replace(",", '').trim());
                }
            }

            for (var flood=0; flood<flood_money.length; flood++) {
                if (flood_money[flood].innerText.replace(",", '').replace(",", '').trim()) {
                    flood_money[flood].innerText = formatMonenyNumber(flood_money[flood].innerText.replace(",", '').replace(",", '').trim());
                }
            }

            for (var city=0; city<city_traffic.length; city++) {
                if (city_traffic[city].innerText.replace(",", '').replace(",", '').trim()) {
                    city_traffic[city].innerText = formatMonenyNumber(city_traffic[city].innerText.replace(",", '').replace(",", '').trim());
                }
            }

            for (var fee=0; fee<other_fee_li.length; fee++) {
                if (other_fee_li[fee].value.replace(",", '').replace(",", '').trim()) {
                    other_fee_li[fee].value = formatMonenyNumber(other_fee_li[fee].value.replace(",", '').replace(",", '').trim());
                }
            }

            for (var i = 0; i<traffic_money.length;i++) {
                cjjtf += Number(traffic_money[i].innerText.replace(",", '').replace(",", '').trim())
                zsf +=Number(sleep_money[i].innerText.replace(",", '').replace(",", '').trim())
                hsf +=Number(flood_money[i].innerText.replace(",", '').replace(",", '').trim())
                cwjtf += Number(city_traffic[i].innerText.replace(",", '').replace(",", '').trim())
            }
            for (var j=0;j<other_fee_li.length;j++) {
                other_fee += Number(other_fee_li[j].value.replace(",", '').replace(",", '').trim())
            }

            total = cjjtf + zsf + hsf+ cwjtf + other_fee
            document.getElementById("total_daxie").innerText = ToString(total);
            document.getElementById("total").innerText = formatMonenyNumber(total);
        }

        function operate_button(ele_id) {
            var id = window.location.href.split("id=")[1];
            if (ele_id === 'is_stop') {
                var state = 'stop';     // 终止
                var word = '终止'
            } else if (ele_id === 'is_cancel') {
                state = 'cancel';       // 作废
                word = '作废'
            } else {
                state = 'recall'
                word = '撤回'
            }
            var r = confirm('是否' + word + '流程？')
            if (r === true) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/finance/TravelRevokeView", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("state=" + state + "&id=" + id)
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            alert(JsonDate['message'])
                            window.location.href = "/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd="
                        }
                    }
                };
            }
        }

        $(document).ready(function() {
            uploaderFilesLoad("uploaderFiles","uploaderInput",5,function(){
                console.log();//多张图片中以逗号分隔
            });
        });

        function remove_time_adress(obj, word) {
            var r = confirm('删除此项？')
            if (r === true) {
                var trNode = $(obj).parent().parent();
                trNode.remove();
                if (word === "1") {
                    var cjjtf = 0;
                    var zsf = 0;
                    var hsf = 0;
                    var cwjtf = 0;
                    var total = 0;
                    var other_fee = 0;
                    var traffic_money = document.getElementsByClassName("t_num")
                    var sleep_money = document.getElementsByClassName("q_m_num")
                    var flood_money = document.getElementsByClassName('f_m_num')
                    var city_traffic = document.getElementsByClassName("i_t_m_num")
                    var other_fee_li = document.getElementsByClassName('other_input')
                    for (var i = 0; i < traffic_money.length; i++) {
                        cjjtf += Number(traffic_money[i].innerText.replace(",", ""))
                        zsf += Number(sleep_money[i].innerText)
                        hsf += Number(flood_money[i].innerText)
                        cwjtf += Number(city_traffic[i].innerText)
                    }

                    for (var j = 0; j < other_fee_li.length; j++) {
                        other_fee += Number(other_fee_li[j].value)
                    }
                    total = cjjtf + zsf + hsf + cwjtf + other_fee
                    document.getElementById("total_daxie").innerText = ToString(total);
                    document.getElementById("total").innerText = formatMonenyNumber(total);
                }
            }
        }

        function add_other() {
            var other = document.getElementById("other");
            var tr_tag = document.createElement("tr");
            var td1 = document.createElement("td");td1.className="time-adress-td";td1.colSpan='3';td1.style.width="10%";td1.style.textAlign='right';td1.style.paddingRight='0.5%';td1.innerText="报销类型";
            var td2 = document.createElement("td");td2.className="time-adress-td other";td2.colSpan='6';td2.style.width="40%";td2.contentEditable='true';
            var td3 = document.createElement("td");td3.className="time-adress-td";td3.style.width="10%";td3.colSpan='3';td3.style.textAlign='right';td3.style.paddingRight='1%';td3.innerText="发票金额";
            var td4 = document.createElement("td");td4.className="time-adress-td";td4.style.width="40%";td4.colSpan='6';td4.contentEditable='true';
            var span_tag = document.createElement("span");span_tag.style.float='right';span_tag.style.paddingRight="10px";span_tag.style.color="red";span_tag.style.cursor="pointer";
            var input_tag = document.createElement("input");input_tag.style.width='90%';input_tag.style.height='100%';input_tag.style.outline='none';input_tag.style.border='none';input_tag.className='other_input';
            input_tag.setAttribute("onblur", 'change_float(this,"F")')
            span_tag.innerText="删除";span_tag.setAttribute("onclick", "remove_time_adress(this, '1')");
            td4.appendChild(input_tag);td4.appendChild(span_tag);
            tr_tag.appendChild(td1);tr_tag.appendChild(td2);tr_tag.appendChild(td3);tr_tag.appendChild(td4);other.appendChild(tr_tag);
        }

        function print_topics() {
            $('#menu_from').jqprint({
                debug: false,
                importCSS: true,
                printContainer: true,
                operaSupport: false
            });
        }

        function ToString(money) {
            console.log(money, '执行了吗');
            //汉字的数字
            var cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
            //基本单位
            var cnIntRadice =['', '拾', '佰', '仟'];
            //对应整数部分扩展单位
            var cnIntUnits = ['', '万', '亿', '兆'];
            //对应小数部分单位
            var cnDecUnits = ['角', '分', '毫', '厘'];
            //整数金额时后面跟的字符
            var cnInteger = '整';
            //整型完以后的单位
            // var cnIntLast = '圆';
            var cnIntLast = '元';
            //最大处理的数字
            var maxNum = 999999999999999.9999;
            //金额整数部分
            var integerNum;
            //金额小数部分
            var decimalNum;
            //输出的中文金额字符串
            var chineseStr = '';
            //分离金额后用的数组，预定义
            var parts;
            if (money === '') { return ''; }
            money = parseFloat(money);
            if (money >= maxNum) {
                //超出最大处理数字
                return '';
            }
            if (money === 0) {
                chineseStr = cnNums[0] + cnIntLast + cnInteger;

                return chineseStr;
            }

            //转换为字符串
            money = money.toString();

            if (money.indexOf('.') === -1) {
                integerNum = money;
                decimalNum = '';
            } else {
                parts = money.split('.');
                integerNum = parts[0];

                decimalNum = parts[1].substring(0, 2);
            }
            //获取整型部分转换
            if (parseInt(integerNum, 10) > 0) {
                var zeroCount = 0;
                var IntLen = integerNum.length;
                for (var i = 0; i < IntLen; i++) {
                    // var n = integerNum.substr(i, 1);
                    var n = integerNum.substring(i, i+1);
                    var p = IntLen - i - 1;
                    var q = p / 4;
                    var m = p % 4;
                    if (n === '0') {
                        zeroCount++;
                    } else {
                        if (zeroCount > 0) {
                            chineseStr += cnNums[0];
                        }
                        //归零
                        zeroCount = 0;
                        chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
                    }
                    if (m === 0 && zeroCount < 4) {
                        chineseStr += cnIntUnits[q];
                    }
                }
                chineseStr += cnIntLast;
            }
            //小数部分
            if (decimalNum !== '') {
                var decLen = decimalNum.length;
                for (var i = 0; i < decLen; i++) {
                    // var n = decimalNum.substr(i, 1);
                    var n = decimalNum.substring(i, i+1);
                    if (n !== '0') {
                        // chineseStr += cnNums[Number(n)] + cnDecUnits[i];
                        chineseStr += cnNums[parseInt(n)] + cnDecUnits[i];
                    }
                }
            }
            if (chineseStr === '') {
                chineseStr += cnNums[0] + cnIntLast + cnInteger;
            } else if (decimalNum === '') {
                chineseStr += cnInteger;
            }

            return chineseStr;
        }

        function change_daxie() {
            document.getElementById("total_daxie").innerText=ToString(document.getElementById("total").innerText.replace(",", '').replace(",", ''));
            document.getElementById("total").innerText = formatMonenyNumber(document.getElementById("total").innerText.replace(",", '').replace(",", ''));
        }

        function formatMonenyNumber(number, toFixed = 2) {
            console.log("转数字：", number)
            let str = [];
            if (!number) return 0
            if (typeof number === "number") number = String(number)
            let tempNumber = number.split('.');
            number = tempNumber[0]
            if (number.length <= 0) {
                if (tempNumber[1]) {
                    var decimils = tempNumber[1].slice(0, toFixed);
                if (decimils.length === 1){
                    decimils = decimils + "0";
                }
                number += '.' + decimils;
                }
                return number
            }
            number.split('').reverse().forEach((item, index) => {
                if (index !== 0 && index % 3 === 0) {
                    str.push(',', item)
                } else {
                    str.push(item)
                }
            })
            number = str.reverse().join('')
            if (tempNumber[1]) {
                var decimils = tempNumber[1].slice(0, toFixed);
                if (decimils.length === 1){
                    decimils = decimils + "0";
                }
                number += '.' + decimils;
            }else {
                 number += '.00'
            }
            return number;
        }

        function SingleChoice(ele_id) {
            var checked_rdo_list = document.getElementsByClassName("checked_rdo");
            for (var i=0; i<checked_rdo_list.length; i++) {
                checked_rdo_list[i].checked = false
            }
            ele_id.checked = true;
        }
        count = Number("{{ data_obj.TotalList|length }}")
        console.log("count: ", count)
        function add_total_project() {
            var html = `<tr><td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_y_num" maxlength="4"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_m_num" oninput="if (value>12)value=12;if (value<=0)value=''"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="s_j_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="s_p"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_m_num" oninput="if (value>12)value=12;if (value<=0)value=''"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="e_j_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="e_p"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="text" class="t_c"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px; outline: none" class="t_num" id="trff_m_` + count + `" onblur=change_float(this,'T') contentEditable="true"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_p_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="q_d_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px; outline: none" class="q_m_num" id=q_m_"` + count + `" onblur=change_float(this,'T') contentEditable="true"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_p_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="f_d_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px;outline: none" class="f_m_num" id="f_m_`+ count + `" onblur=change_float(this,'T') contentEditable="true"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_p_num"></td>
                            <td style="width: 5%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px"><input type="number" class="i_t_d_num"></td>
                            <td style="width: 15%; border: #cfcfcf solid 0.5px;  text-align: center;border-bottom: none; line-height: 40px; outline: none">
                                <span class="i_t_m_num" id="i_t_m_`+ count + `" onblur=change_float(this,'T') contentEditable="true" style="padding-left: 10px;outline: none;width:70%; display: -moz-inline-box; display: inline-block;"></span>
                                <span onclick="remove_time_adress(this, '1')" style="color: red; cursor: pointer; display: inline-block;">删除</span>
                            </td>
                        </tr>`
            $("#total_table").append(html);
            count++
        }


        {#  T 费用详情； F其他费用  #}
        function change_float(this_, STR) {
            console.log(this_.innerText)
            var cjjtf = 0;var zsf = 0; var hsf = 0; var cwjtf = 0;var total = 0;var other_fee = 0;
            if (STR === "T") {
                this_.innerText = formatMonenyNumber(this_.innerText.replace(",", '').replace(",", '').trim());
            }else{
                console.log(this_)
                this_.value = formatMonenyNumber(this_.value.replace(",", '').replace(",", '').trim());
            }

            var traffic_money = document.getElementsByClassName("t_num")
            var sleep_money = document.getElementsByClassName("q_m_num")
            var flood_money = document.getElementsByClassName('f_m_num')
            var city_traffic = document.getElementsByClassName("i_t_m_num")
            var other_fee_li = document.getElementsByClassName('other_input')
            for (var i = 0; i<traffic_money.length;i++) {
                cjjtf += Number(traffic_money[i].innerText.replace(",", '').replace(",", '').trim())
                zsf +=Number(sleep_money[i].innerText.replace(",", '').replace(",", '').trim())
                hsf +=Number(flood_money[i].innerText.replace(",", '').replace(",", '').trim())
                cwjtf += Number(city_traffic[i].innerText.replace(",", '').replace(",", '').trim())
            }
            for (var j=0;j<other_fee_li.length;j++) {
                other_fee += Number(other_fee_li[j].value.replace(",", '').replace(",", '').trim())
            }
            total = cjjtf + zsf + hsf+ cwjtf + other_fee
            document.getElementById("total_daxie").innerText = ToString(total);
            document.getElementById("total").innerText = formatMonenyNumber(total);
        }

        let title4 = document.querySelector("#title4");
        let addForm5 = document.querySelector("#addForm5");
        title4.addEventListener("mousedown", function (e) {
            let x = e.pageX - addForm5.offsetLeft;
            let y = e.pageY - addForm5.offsetTop;


            document.addEventListener("mousemove", move);
            function move(e) {
                addForm5.style.left = e.pageX - x + 'px';
                addForm5.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        function scrollConversationScreen() {
            $('#selected-div').scrollTop($('#selected-div')[0].scrollHeight);
        }

        function IdentifyPersonnel() {
            var prople_list = [];
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            for (var i=0; i<selected_personnel_list.length; i++) {
                prople_list.push(selected_personnel_list[i].innerText)
            }
            document.getElementById("conferee").value = prople_list.join();
            close_model()
        }
    </script>
{% endblock %}
